<?php

final class Bike_Version
{	const NAME = 'Bike Project';
	const YEAR = '2012';
	const VERSION = '1.0';

	protected static $_latestVersion;

	public static function compareVersion($Version)
    {
        $version = strtolower($Version);
        $version = preg_replace('/(\d)pr(\d?)/', '$1a$2', $version);
        return version_compare($version, strtolower(self::VERSION));
    }

    public static function getLatest()
    {
        if (null === self::$_latestVersion) {
            self::$_latestVersion = 'not available';

            /*$handle = fopen('http://...', 'r');
            if (false !== $handle) {
                self::$_latestVersion = stream_get_contents($handle);
                fclose($handle);
            }*/
        }

        return self::$_latestVersion;
    }

    public static function getYear()
    {    	return self::YEAR;
    }

    public static function getVersion()
    {
    	return self::VERSION;
    }

    public static function getName()
    {
    	return self::NAME;
    }
}